#include "judge.h"

Judge::Judge()
{

}

QString Judge::Cate()
{
    return "判断";
}

int Judge::Review(QString ans)
{
    if(ans == this->m_res)
        return this->m_score;
    return 0;
}

void Judge::Save()
{
    QFile file(this->m_title.left(10));
    file.open(QIODevice::ReadOnly | QIODevice::WriteOnly);      //只读的方式打开

    file.write(this->m_title.toUtf8() + "\n");
    file.write(this->m_res.toUtf8() + "\n");
    file.write(this->Cate().toUtf8() + "\n");
    file.write(QString::number(this->m_score).toUtf8() + "\n");

    file.close();                       //关闭文件对象
}
